#include "playwid.h"

playWid::playWid(bool isPlaying, QString playIcon, QString pauseIcon)
{
        playPix = new QPixmap(QString(QApplication::applicationDirPath() + "/themes" + playIcon));
        pausePix = new QPixmap(QString(QApplication::applicationDirPath() + "/themes" + pauseIcon));

        this->updateStatus(isPlaying);
}

void playWid::mousePressEvent ( QGraphicsSceneMouseEvent * event )
{
        emit this->pauseToggled();
        qDebug() << "pauseToggled()";
}

void playWid::updateStatus(bool status)
{
    qDebug() << "play => updateStatus";
    if(status == true){
        this->setPixmap(*pausePix);
    }else{
        this->setPixmap(*playPix);
    }
}
